package cn.wolfcode.trip.base.domain;

import cn.wolfcode.trip.base.util.JSONUtil;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Getter;
import lombok.Setter;

import java.util.HashMap;

//大攻略
@Getter@Setter
@JsonIgnoreProperties({"handler", "json"})
public class Strategy extends BaseDomain{
    public static final int STATE_DISABLE = -1;//禁用
    public static final int STATE_NORMAL = 0;//草稿
    public static final int STATE_ABLE = 1;//启用

    //地区
    private Region place;

    //标题
    private String title;

    //副标题
    private String subTitle;

    //封面
    private String coverUrl;

    //状态
    private Integer state;

    //攻略点赞数
    private Integer likeCount;

    //攻略收藏数
    private Integer collectCount;

    public String getJson(){
        HashMap<String, Object> map = new HashMap<>();
        map.put("id",id);
        map.put("title",title);
        map.put("subTitle",subTitle);
        map.put("subTitle",subTitle);
        map.put("coverUrl",coverUrl);
        map.put("state",state);
        if (place!=null){
            map.put("placeId",place.getId());
        }
        return JSONUtil.toJSONString(map);

    }
}